home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / mlapi.zip / MLAPI.PAS < prev    next >
Pascal/Delphi Source File  |  1990-02-23  |  3KB  |  133 lines

  1. UNIT MLAPI; {MultiLink Advanced Interface}
  2. {Version 1.0}
  3.  
  4. {
  5. Donald M. DeLapp
  6. 485 S. Sheridan Ave.
  7. Sheridan, WY  82801
  8. 307-674-6841
  9.  
  10. MultiLink has more functions than this,
  11. but these are all that I have used in my software
  12. }
  13.  
  14. INTERFACE
  15.  
  16. USES Dos;
  17.  
  18.  
  19. FUNCTION MultiLinkLoaded : BOOLEAN;
  20. {
  21. returns true if MultiLink is installed
  22. }
  23.  
  24.  
  25. PROCEDURE Enque( What : INTEGER;
  26.                  Wait : BOOLEAN;
  27.                  VAR Result : INTEGER );
  28. {
  29. enques resource identified by What
  30. (system maximum of 100 resources enqued at one time)
  31.  
  32. if Wait is TRUE will not return until resource is available
  33.  
  34. Result 0 = resource enqued
  35.        1 = resource not available
  36.        2 = user error
  37. }
  38.  
  39.  
  40. PROCEDURE Deque( What : INTEGER;
  41.                  VAR Result : INTEGER );
  42. {
  43. deques resource identified by What
  44. (even if resource was enqued by another task)
  45.  
  46. Result 0 = resource dequed
  47.        2 = user error
  48. }
  49.  
  50.  
  51. PROCEDURE SetTaskPriority( N : INTEGER );
  52. {
  53. sets task priority of the current task (N = 0..7)
  54. }
  55.  
  56.  
  57. PROCEDURE SetKbdTest( N : INTEGER );
  58. {
  59. sets task status for the current task if
  60. application is repeatedly testing the keyboard
  61. }
  62. CONST
  63. { Constants for setting keyboard test }
  64. DIS = 1;     {disable until keyboard input detected}
  65. NODIS = 0;   {normal}
  66. NVDIS = 255; {never disable}
  67.  
  68.  
  69. FUNCTION MLVIDRAMActive : BOOLEAN;
  70. {
  71. returns TRUE if MLVIDRAM is active
  72. }
  73.  
  74.  
  75. FUNCTION GetMultiLinkVideoSegment : WORD;
  76. {
  77. returns segment address of MLVIDRAM video buffer for the current partition,
  78. direct video access should go here for a terminal, BIOS video access faster
  79. unless using 286 with memory management unit
  80. }
  81.  
  82.  
  83. PROCEDURE SetTaskTimeSlice( N : INTEGER );
  84. {
  85. sets task time slice for the current task (N = 1..18)
  86. }
  87.  
  88.  
  89. FUNCTION GetPartitionNo : INTEGER;
  90. {
  91. returns partition number of the current task
  92. }
  93.  
  94.  
  95. PROCEDURE TaskSwitch;
  96. INLINE($B4/$02/ {MOV AH,2}
  97.        $CD/$7F  {INT 7Fh });
  98. {
  99. yield
  100. not necessary when MLSLICE is used, but helpful in keeping a
  101. disk intensive task from taking too much time from other tasks
  102. }
  103.  
  104.  
  105. IMPLEMENTATION
  106.  
  107.  
  108. {$L MLAPI.OBJ}
  109.  
  110. FUNCTION MultiLinkLoaded : BOOLEAN; EXTERNAL;
  111.  
  112. PROCEDURE Enque( What : INTEGER;
  113.                  Wait : BOOLEAN;
  114.                  VAR Result : INTEGER ); EXTERNAL;
  115.  
  116. PROCEDURE Deque( What : INTEGER;
  117.                  VAR Result : INTEGER ); EXTERNAL;
  118.  
  119. PROCEDURE SetTaskPriority( N : INTEGER ); EXTERNAL;
  120.  
  121. PROCEDURE SetKbdTest( N : INTEGER ); EXTERNAL;
  122.  
  123. FUNCTION MLVIDRAMActive : BOOLEAN; EXTERNAL;
  124.  
  125. FUNCTION GetMultiLinkVideoSegment : WORD; EXTERNAL;
  126.  
  127. PROCEDURE SetTaskTimeSlice( N : INTEGER ); EXTERNAL;
  128.  
  129. FUNCTION GetPartitionNo : INTEGER;  EXTERNAL;
  130.  
  131. END.
  132.  
  133.